package com.example.demo.finitestatemachine.state;


import com.example.demo.finitestatemachine.transition.AbstractLiftTransition;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * @author liyuncong
 * @version 1.0
 * @file LiftState
 * @brief LiftState
 * @details LiftState
 * @date 2022-12-28
 *
 * Edit History
 * ----------------------------------------------------------------------------
 * DATE                        NAME               DESCRIPTION
 * 2022-12-28                  liyuncong          Created
 */
public class LiftState {

    private final LiftStateCodeEnums stateCode;

    private final List<AbstractLiftTransition> transitions = new ArrayList<>();

    public LiftState(LiftStateCodeEnums stateCode, AbstractLiftTransition... transitions) {
        this.stateCode = stateCode;
        this.transitions.addAll(Arrays.asList(transitions));
    }

    public void addTransition(AbstractLiftTransition transition) {
        this.transitions.add(transition);
    }

    public LiftStateCodeEnums getStateCode() {
        return stateCode;
    }

    public List<AbstractLiftTransition> getTransitions() {
        return transitions;
    }
}
